﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using XXTBaseService;
using XXTBaseService.XXTWebService;


namespace TestSync
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent(); 
        }

        private void ShowMsg(ErrorMsg error) 
        {
            if (error != null)
            {
                MessageBox.Show(error.Description + "\r\n" + error.Remark);
            }
            else
            {
                MessageBox.Show("操作完成");
            }
        }
        private void btnStu_Click(object sender, EventArgs e)
        {
            var error = DataSync.StudentDataSync(ActionCode.修改);
            ShowMsg(error);
        }

        private void btnAddTea_Click(object sender, EventArgs e)
        {
            var error = DataSync.TeacherDataSync(ActionCode.添加);
            ShowMsg(error);
        }

        private void btnAddFamily_Click(object sender, EventArgs e)
        {
            var error = DataSync.FamilyDataSync(ActionCode.添加);
            ShowMsg(error);
        }

        private void btnSendDown_Click(object sender, EventArgs e)
        {
            List<string> list =new List<string>();
            var error = DataSync.Downsms(DownSmsType.教师发送给教师, list);
            ShowMsg(error);
        }

        private void btnUpSms_Click(object sender, EventArgs e)
        {
            var error = DataSync.Upsms(UpSmsType.教师回复);
            ShowMsg(error);
        }
    }
}
